package com.zhehekeji.opsys.api.webservice.server;

import javax.jws.WebService;

import org.apache.cxf.interceptor.InInterceptors;
import org.apache.cxf.interceptor.OutInterceptors;
import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;
import org.springframework.beans.factory.annotation.Autowired;

import com.zhehekeji.opsys.api.req.LuckyAnswerReq;
import com.zhehekeji.opsys.api.resp.GetSurveyListResp;
import com.zhehekeji.opsys.api.resp.GetSurveyQuestionListResp;
import com.zhehekeji.opsys.api.resp.GetSurveyQuestionResp;
import com.zhehekeji.opsys.api.resp.GetSurveyResp;
import com.zhehekeji.opsys.api.resp.LuckyAnswerResp;
import com.zhehekeji.opsys.api.service.manager.SurveyManagerService;

/**
 * @ClassName SurveyManagerWS
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2016-11-11   下午1:40:43
 */
@InInterceptors(classes={GZIPInInterceptor.class})
@OutInterceptors(classes={GZIPOutInterceptor.class})
@WebService(endpointInterface="com.zhehekeji.opsys.api.webservice.server.SurveyManager",
name="surveyManager",portName="surveyManagerPort",serviceName="surveyManagerWS")
public class SurveyManagerWS implements SurveyManager {

	@Autowired
	private SurveyManagerService surveyManagerService;
	
	@Override
	public GetSurveyResp getSurvey(String surveyCode) {
		return surveyManagerService.getSurvey(surveyCode);
	}

	@Override
	public GetSurveyListResp getSurveyList(long cpCode, int firstIndex, int maxResult) {
		return surveyManagerService.getSurveyList(cpCode, firstIndex, maxResult);
	}

	@Override
	public GetSurveyQuestionListResp getSurveyQuestionList(String surveyCode, int firstIndex, int maxResult) {
		return surveyManagerService.getSurveyQuestionList(surveyCode, firstIndex, maxResult);
	}

	@Override
	public LuckyAnswerResp luckyAnswer(LuckyAnswerReq luckyAnswerReq) {
		return surveyManagerService.luckyAnswer(luckyAnswerReq);
	}

	@Override
	public GetSurveyQuestionResp getCurrentSurveyQuestion(String surveyCode, String userID) {
		return surveyManagerService.getCurrentSurveyQuestion(surveyCode, userID);
	}

}

